package gnar.euler
import scala.Math.pow

class ProblemTwentyEight extends Problem{
  
  override def solve = {
    printf("P28 ans: %d\n" , lGen(1001).reduceLeft(_+_))
  }
  
  def lGen(end: Int): List[Int] = {
    1 :: List.range(3 , end + 1 , 2).map( n => 4*n*n - 6*n + 6)
  }
}